package sample.config.client.withbus.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import sample.config.client.withbus.utils.ApplicationContextUtil;

@RestController
@RefreshScope
public class TestController {

    @Value("${data.env}")
    String env;

    @GetMapping("/test")
    public String test(){
//        return "Hello!My env is: "+
//                ApplicationContextUtil.applicationContext
//                        .getEnvironment().getProperty("data.env");
        return "Hello!My env is: "+env;
    }
}
